<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{$meta_title}</h2>
	</div>
	<form id="form" action="__SELF__" method="post" class="form-horizontal">
	<ul class="text-form">
		<li>
			<h3>任务标题</h3>
			<div class="content">{$info.title}</div>
		</li>
		<li>
			<h3>截止日期</h3>
			<div class="content">{$info.over_time|time_format='Y-m-d'}</div>
		</li>
		<li>
			<h3>派发日期</h3>
			<div class="content">{$info.send_time|time_format='Y-m-d'}</div>
		</li>
		<li>
			<h3>派发用户</h3>
			<div class="content">{$info.uid|get_nickname}</div>
		</li>
		<li>
			<h3>任务内容</h3>
			<div class="content">{$info.content}</div>
		</li>
		<li>
			<h3>任务附件</h3>
			<div class="content"><a title="点击下载" href="{:U('Calendar/download?id='.$info['file_id'])}">{$info.file_name}</a></div>
		</li>
		<li>
			<h3>执行回执</h3>
			<div>
				<label class="textarea">
					<textarea name="remark">{$info.remark}</textarea>
					{:hook('adminArticleEdit', array('name'=>'remark','value'=>$info['remark']))}
				</label>
			</div>
		</li>
		<li>
			<h3>回执文件</h3>
			<div class="content">
				<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
				<input type="file" id="upload_file">
				<input type="hidden" name="return_id" value="{$info.return_id}"/>
				<div class="upload-img-box">
					<present name="info.return_name">
						<div class="upload-pre-file"><span class="upload_icon_all"></span>{$info.return_name}</div>
					</present>
				</div>
				<present name="info.return_name">
					<a href="{:U('Calendar/download?id='.$info['return_id'])}">点此下载文件</a>
				</present>
				<script type="text/javascript">
				//上传图片
			    /* 初始化上传插件 */
				$("#upload_file").uploadify({
			        "height"          : 30,
			        "swf"             : "__STATIC__/uploadify/uploadify.swf",
			        "fileObjName"     : "download",
			        "buttonText"      : "上传附件",
			        "uploader"        : "{:U('File/upload',array('session_id'=>session_id()))}",
			        "width"           : 120,
			        'removeTimeout'	  : 1,
			        "onUploadSuccess" : uploadFile,
			        'onFallback' : function() {
						alert('未检测到兼容版本的Flash.');
					}
			    });
				function uploadFile(file, data){
					var data = $.parseJSON(data);
			        if(data.status){
			        	var name = "return_id";
			        	$("input[name='return_id']").val(data.data);
			        	$("input[name='return_id']").parent().find('.upload-img-box').html(
			        		"<div class=\"upload-pre-file\"><span class=\"upload_icon_all\"></span>" + data.info + "</div>"
			        	);
			        } else {
			        	updateAlert(data.info);
			        	setTimeout(function(){
			                $('#top-alert').find('button').click();
			                $(that).removeClass('disabled').prop('disabled',false);
			            },1500);
			        }
			    }
				</script>
			</div>
		</li>
		<li>
			<div style="padding: 8px 10px;">
				<input type="hidden" name="cal_id" value="{$info.cal_id}" />
				<input type="hidden" name="to_uid" value="{$info.to_uid}" />
				<button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal" url="?action=ok">完成任务</button>
				<button type="submit" class="btn save-btn ajax-post" target-form="form-horizontal">保存进度</button>
				<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
			</div>
		</li>
	</ul>
	</form>
</block>

<block name="script">
<script type="text/javascript">
	highlight_subnav("{:U('Calendar/mine')}");
</script>
</block>